package services;

import Dao.EmployeeDao;
import entity.CourtsBean;
import entity.EmployeeBean;
import entity.PositiontypeBean;
import java.math.BigDecimal;
import java.sql.SQLException;
import java.util.List;

public class EmployeeService {
    private EmployeeDao employeeDap = new EmployeeDao();
    //获取所有员工所有信息
    public List<EmployeeBean> getEmployeeAll(){
        return employeeDap.getEmployeeAll();
    }
    //通过id获取指定员工信息
    public EmployeeBean getEmployeeID(int employee_id){
        return employeeDap.getEmployeeID(employee_id);
    }
    //添加员工
    public int addEmployee(EmployeeBean employeeBean){
        return employeeDap.addEmployee(employeeBean);
    }
    //修改员工
    public int updateEmployeeById(EmployeeBean employeeBean){
        try {
            return employeeDap.updateEmployeeById(employeeBean);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }
    //修改员工工资
    public int updateEmployeesWages(BigDecimal employeesWages, int employee_id){
        return employeeDap.updateEmployeesWages(employeesWages,employee_id);
    }
    //查询在职员工
    public List<EmployeeBean> getEmployeeStateAll(boolean employeeStatus){
        return employeeDap.getEmployeeStateAll(employeeStatus);
    }
    public PositiontypeBean getByPositionType_name(String PositionType_name){
        return employeeDap.getByPositionType_name(PositionType_name);
    }
    public List<EmployeeBean> getEmployeeName(String employee_name){
        return employeeDap.getEmployeeName(employee_name);
    }
}